import {
	httpRequest
} from '../utils/request';


// 登录
export function login(data) {
	return httpRequest({
		url: '/login/wxMini',
		method: 'post',
    header: {
			'content-type': 'application/x-www-form-urlencoded'
		},
    params: data
	})
}

// 上传签名
export function getSign() {
	return httpRequest({
		url: '/document/getSign',
		method: 'post',
	})
}
// 文章列表
export function list(data) {
	return httpRequest({
		url: '/document/list',
		method: 'post',
   	data
	})
}

// 最热10条文章
export function hot() {
	return httpRequest({
		url: '/document/hot',
		method: 'post',
	})
}

// 最新20条文章
export function latest() {
	return httpRequest({
		url: '/document/latest',
		method: 'post',
	})
}


// 栏目树
export function getDirectoryTree() {
	return httpRequest({
		url: '/directory/getDirectoryTree',
		method: 'post'
	})
}


// 是否有权限访问
export function hasPermission(data) {
	return httpRequest({
		url: '/document/hasPermission',
		method: 'post',
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		},
    params: data
	})
}
// 是否有权限访问
export function apply(data) {
	return httpRequest({
		url: '/document/apply',
		method: 'post',
		header: {
			'content-type': 'application/x-www-form-urlencoded'
		},
    params: data
	})
}
// 文章详情
export function getDetailById(data) {
	return httpRequest({
		url: '/document/getDetailById',
		method: 'get',
    data
	})
}
export function syncMiniUserInfo(data) {
	return httpRequest({
		url: '/user/syncMiniUserInfo',
		method: 'post',
    data
	})
}



